/**
 * 提交
 */
function doSubmit() {
	
	WEB.msg.info("提示", "保存成功", function () {
                    window.location.href = "roleList.html";
                });
    return ;

}


function showTree() {
	var setting = {
        check: {
            enable: true
        },
        data: {
            simpleData: {
                enable: true, idKey: "id", pIdKey: "pId", rootPId: ''
            }
        },
        callback: {
            onCheck: onCheck
        }
    };
	$.fn.zTree.init($("#treeDemo"), setting, menuTreeData).expandAll(true);
	return;

}

//点击选中事件
function onCheck(e, treeId, treeNode) {
    var treeObj = jQuery.fn.zTree.getZTreeObj("treeDemo"),
        nodes = treeObj.getCheckedNodes(true);
    var dirId = '';
    for (var i = 0; i < nodes.length; i++) {
        dirId += nodes[i].id + ","; //获取选中节点的值
        //roleArr.push(nodes[i].id);
    }
    dirId = dirId.replace(/,$/, "");
    $('#menuIds').val(dirId);
}


function goBack() {
    window.location.href = "roleList.html";
}

$(function () {


    showTree();


});